package com.vzaar;

/**
 * Active video details along with it's relevant metadata.
 * 
 * @author Marc G. Smith
 */
public class Video 
{
	///////////////////////////////////////////////////////////////////////////
	// Private Members ////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////
	
	private double version;
	private int id;
	private String title;
	private String description;
	private String createdAt;
	private String url;
	private String thumbnailUrl;
	private int playCount;
	private String authorName;
	private String authorUrl;
	private int authorAccount;
	private int videoCount;
	private double duration;
	private int width;
	private int height;
	
	///////////////////////////////////////////////////////////////////////////
	// Public and Package Protected Methods ///////////////////////////////////
	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * Package protected constructor.
	 * 
	 * @param version the vzaar API version number
	 * @param id the video ID number
	 * @param title the video title. It may be null
	 * @param description the video description. It may be null 
	 * @param createdAt the date time the video was uploaded 
	 * @param url the link to the video page
	 * @param thumbnailUrl the URL link that points to the video thumbnail  
	 * @param playCount the number of times the video has been played
	 * @param authorName the vzaar user name (i.e. their login)
	 * @param authorUrl the link to the vzaar user summary page 
	 * @param authorAccount the number representing the users vzaar account
	 * @param videoCount the number of active videos in the users account 
	 * @param duration the duration of the video
	 * @param width the width of the video
	 * @param height the height of the video
	 */
	Video(
		double version, int id, String title, String description, 
		String createdAt, String url,
		String thumbnailUrl, int playCount, String authorName,
		String authorUrl, int authorAccount, int videoCount,
		double duration, int width, int height) 
	{
		this.version = version;
		this.id = id;
		this.title = title;
		this.description = description;
		this.createdAt = createdAt;
		this.url = url;
		this.thumbnailUrl = thumbnailUrl;
		this.playCount = playCount;
		this.authorName = authorName;
		this.authorUrl = authorUrl;
		this.authorAccount = authorAccount;
		this.videoCount = videoCount;
		this.duration = duration;
		this.width = width;
		this.height = height;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The vzaar user name (i.e. their login)
	 * 
	 * @return the authorName
	 */
	public String getAuthorName() {
		return authorName;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The link to the vzaar user summary page
	 * 
	 * @return the link to the vzaar user summary page
	 */
	public String getAuthorUrl() {
		return authorUrl;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The number representing the users vzaar account. 1 represents a free 
	 * account.
	 * 
	 * @return the number representing the users vzaar account
	 */
	public int getAuthorAccount() {
		return authorAccount;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The number of active videos in the users account.
	 * 
	 * @return the number of active videos in the users account
	 */
	public int getVideoCount() {
		return videoCount;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The vzaar API version number.
	 * 
	 * @return the vzaar API version number
	 */
	public double getVersion() {
		return version;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The video ID number.
	 * 
	 * @return the video ID number
	 */
	public int getId() {
		return id;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The video title. It may be null.
	 * 
	 * @return the video title
	 */
	public String getTitle() {
		return title;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The video description. It may be null.
	 * @return the video description
	 */
	public String getDescription() {
		return description;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The date time the video was uploaded. Will be in UTC format.
	 * 
	 * @return the date time the video was uploaded
	 */
	public String getCreatedAt() {
		return createdAt;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The link to the video page.
	 * 
	 * @return the link to the video page
	 */
	public String getUrl() {
		return url;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The URL link that points to the video thumbnail. This is usually 
	 * 120x90px.
	 * 
	 * @return the URL link that points to the video thumbnail
	 */
	public String getThumbnailUrl() {
		return thumbnailUrl;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The number of times the video has been played.
	 * 
	 * @return the number of times the video has been played
	 */
	public int getPlayCount() {
		return playCount;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The duration of the video.
	 * 
	 * @return the duration of the video
	 */
	public double getDuration() {
		return duration;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The width of the video.
	 * 
	 * @return the width of the video
	 */
	public int getWidth() {
		return width;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * The height of the video.
	 * 
	 * @return the height of the video
	 */
	public int getHeight() {
		return height;
	}

	///////////////////////////////////////////////////////////////////////////
	
	/**
	 * String representation of the video bean.
	 * 
	 * @return the string representing the beans details.
	 */
	public String toString() {
		return 
			"version=" + version +
			", id=" + id +
			", title=" + title +
			", description=" + description +
			", createdAt=" + createdAt +
			", url=" + url +
			", thumbnailUrl=" + thumbnailUrl +
			", playCount=" + playCount +
			", duration=" + duration +
			", width=" + width +
			", height=" + height +
			", authorName=" + authorName +
			", authorAccount=" + authorAccount +
			", authorUrl=" + authorUrl +
			", videoCount=" + videoCount;
	}

	///////////////////////////////////////////////////////////////////////////
}
